<?php
require "../../system/framework.php";

//global $userTable;
$login=trim($_REQUEST['login']);

//$loginInformation = new login_information();
$loginInformation=user::getLoginInformation($login);

if ($loginInformation->foundLogin)
    {

    $html='<p>Zugangsdaten:</p>
<table width="38%" border="0">
  <tr>
    <td>URL</td>
    <td><a href="' . url::getCurrentHost() . '"><strong>' . url::getCurrentHost() . '</strong></a></td>
  </tr>
  <tr>
    <td width="32%">Login</td>
    <td width="68%"><strong>' . $loginInformation->login . '</strong></td>
  </tr>
  <tr>
    <td>Passwort</td>
    <td><strong>' . $loginInformation->password . '</strong></td>
  </tr>
</table>';


    //$loginInformation->login." - ".$loginInformation->password;

    $mailFilename="[php_property:mail]";

    if ($mailFilename !== "")
        {

        //newsletter::sendNewsletter($mailFilename, $loginInformation->userTable, "id='{$loginInformation->id}'");

        form_mail::sendFormMailFilename($mailFilename, $loginInformation->userTable, $loginInformation->id);
        }
    else
        {

        $mail=new mail();
        $mail->to=$loginInformation->login;
        $mail->subject="Zugangsdaten";
        $mail->body=$html;
        $mail->send();
        }


    //$mail->sendAlertmail("new_user", $loginInformation->userTable, $loginInformation->id2);

    //http::redirect("[php_property:redirect]");
    }
else
    {
    echo "<p>Die eMail Adresse <b>$login</b> wurde nicht gefunden.</p>";
    exit;
    }

http::redirect("[php_property:action]");
?>